using System;
using System.Threading;
namespace AppToolKit.Core.Utils
{
	public class AutoIncrementSeed
	{
		private int seed_;
		private int incStep_ = 1;
		public int IncStep
		{
			get
			{
				return this.incStep_;
			}
			set
			{
				this.incStep_ = value;
			}
		}
		public AutoIncrementSeed(int seed)
		{
			this.seed_ = seed;
		}
		public AutoIncrementSeed(string seedNumber)
		{
			this.seed_ = Convert.ToInt32(seedNumber);
		}
		public void Inc()
		{
			Monitor.Enter(this);
			try
			{
				this.seed_ += this.incStep_;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public int Seed()
		{
			Monitor.Enter(this);
			int result;
			try
			{
				result = this.seed_;
			}
			finally
			{
				Monitor.Exit(this);
			}
			return result;
		}
		public string SeedNumber()
		{
			Monitor.Enter(this);
			string result;
			try
			{
				result = Convert.ToString(this.seed_);
			}
			finally
			{
				Monitor.Exit(this);
			}
			return result;
		}
	}
}
